/****************************************
* James Gomez                           *
* Project 3: Target Practice P3         *
* Comp 465                              *
* Professor Barnes                      *
* 12/7/2012                             *
*****************************************/

#ifndef _SUN_
#define _SUN_

#include "GomezJamesP3_OpenGL.h"
#include "GomezJamesP3_Object3D.cpp"
#include "GomezJamesP3_CollidableObject.cpp"

#include <string>
using namespace std;


/***********************************************************************
3D collidable object that draws itself as a solid spehere at the origin.
************************************************************************/
class Sun: public CollidableObject{

private:
	Color color[3];
	GLdouble radius;
	GLdouble gravity;

public:
	Sun(const string name, const GLdouble radius, const Color color[3]);
	~Sun(){}

	void draw();
	
};


Sun::Sun(const string name, const GLdouble radius, const Color color[3]): 
		CollidableObject(name, radius){

	this->radius = radius;
	gravity = GRAVITY_CONST;

	for (int i=0; i<3; i++)
		this->color[i] = color[i];		
}

void Sun::draw(){
	glMatrixMode(GL_MODELVIEW);
	glPushMatrix();
	glMultMatrixf(TM); //Ruber's TM is always the identity matrix (at the origin)
	glColor3fv(color);
	glutSolidSphere(radius, SPHERE_SLICES, SPHERE_STACKS);
	glPopMatrix();
}


#endif